package com.capgemini.cn.authority.rest.valueobject.data;

import com.capgemini.cn.authority.data.entity.Asserts;
import com.capgemini.cn.authority.data.entity.AssertsGroup;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.NoArgsConstructor;

import java.sql.Timestamp;

/**
 * Created at 2017/11/1
 *
 * @author Andriy
 */
@ApiModel(value = "资源值对象")
@JsonSerialize
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@NoArgsConstructor
public class AssetVO extends Asserts {

    @ApiModelProperty(value = "资源名称")
    @Override
    public String getAssertName() {
        return super.getAssertName();
    }

    @ApiModelProperty(value = "资源值")
    @Override
    public String getAssertValue() {
        return super.getAssertValue();
    }

    @JsonIgnore
    @Override
    public AssertsGroup getAssertsGroup() {
        return super.getAssertsGroup();
    }

    @JsonProperty(value = "groupName")
    @ApiModelProperty(value = "资源所在的分组名")
    public String assetGroupName() {
        return super.getAssertsGroup().getAssertsGroupName();
    }

    @ApiModelProperty(value = "资源数据主键")
    @Override
    public long getId() {
        return super.getId();
    }

    @ApiModelProperty(value = "资源创建时间")
    @Override
    public Timestamp getCreateTime() {
        return super.getCreateTime();
    }

    @JsonIgnore
    @Override
    public Timestamp getUpdateTime() {
        return super.getUpdateTime();
    }
}
